feat: add Chronicle NativeDashboard resource#16735
feat: add Chronicle NativeDashboard resource#16735divyamjain000 wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Conversation
0b78cb2 to
f54a9c4
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
dashboard_id = # value needed
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
f54a9c4 to
1a124be
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
dashboard_id = # value needed
filters {
chart_ids = # value needed
field_path = # value needed
is_mandatory = # value needed
}
is_pinned = # value needed
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
dashboard_id = # value needed
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
f9002f0 to
d4db073
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
dashboard_id = # value needed
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
dashboard_id = # value needed
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
| api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances.nativeDashboards' | ||
| base_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/nativeDashboards | ||
| update_mask: true | ||
| update_verb: PATCH |
There was a problem hiding this comment.
nit; Can we move these two down and keep all the links together for better readability?
| properties: | ||
| - name: charts | ||
| type: Array | ||
| ignore_read: true |
There was a problem hiding this comment.
Is there a specific reason for ignore_read: true on the charts property? I believe the dashboard definition is returned by the API on GET requests. If we ignore it on read, Terraform won't be able to detect drift if charts are modified outside of Terraform (e.g., via the UI). If the API response for this field is consistent, we should remove this to ensure full state management.
| properties: | ||
| - name: chartLayout | ||
| type: NestedObject | ||
| ignore_read: true |
There was a problem hiding this comment.
Similar to the charts array, why is ignore_read: true set for chartLayout? If the layout coordinates are returned by the API, they should be tracked in the state to allow users to manage the dashboard layout via Terraform.
|
|
||
| examples: | ||
| - name: chronicle_nativedashboard_basic | ||
| primary_resource_id: my-basic-dashboard |
There was a problem hiding this comment.
nit; While not a blocker, using underscores consistently (e.g., my_basic_dashboard) aligns better with common Terraform practices.
| custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl' | ||
| description: The unique ID of the Dashboard. | ||
|
|
||
| - name: access |
There was a problem hiding this comment.
For both the access and type fields, consider changing the type from String to Enum and formally listing the enum_values. This allows Terraform to catch typos or invalid values locally before even making an API call, improving the user experience.
There was a problem hiding this comment.
Are these values going to be expanded in the future? We tend to prefer strings is the set of values is mutable, but enums if it's relatively static. For example, if you're planning to add several other values here in the next few years, it tends to be easier for users if they don't have to upgrade provider versions to be able to use them
There was a problem hiding this comment.
I've updated the properties to enum type that are very unlikely to be updated in the future and rest are kept as strings only.
There was a problem hiding this comment.
Seems like the change hasn't been pushed to github, can you please check?
There was a problem hiding this comment.
Yes, this has been updated and only the filterOperator values has been kept as ENUM.
| output: true | ||
| description: The full resource name of the dashboard. | ||
|
|
||
| - name: dashboardId |
There was a problem hiding this comment.
Is dashboardId not user-settable? It should be per https://google.aip.dev/133#user-specified-ids
There was a problem hiding this comment.
No, this is set in the BE only.
| custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl' | ||
| description: The unique ID of the Dashboard. | ||
|
|
||
| - name: access |
There was a problem hiding this comment.
Are these values going to be expanded in the future? We tend to prefer strings is the set of values is mutable, but enums if it's relatively static. For example, if you're planning to add several other values here in the next few years, it tends to be easier for users if they don't have to upgrade provider versions to be able to use them
|
|
||
| - name: dashboardUserData | ||
| type: NestedObject | ||
| flatten_object: true |
There was a problem hiding this comment.
I don't think flatten object makes sense with an object with child fields
There was a problem hiding this comment.
This one seems unnecessary. Removed flatten object.
|
|
||
| - name: definition | ||
| type: NestedObject | ||
| flatten_object: true |
There was a problem hiding this comment.
Again, why flatten object
There was a problem hiding this comment.
Our BE expects the update mask to be more granular such as "definition.chartLayout" instead of only "definition. By flattening it, we can get the update mask at the child level.
d4db073 to
a1e0eb3
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
a1e0eb3 to
6867ce7
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_native_dashboard" "primary" {
charts {
chart_layout {
span_x = # value needed
span_y = # value needed
start_x = # value needed
start_y = # value needed
}
dashboard_chart = # value needed
filters_ids = # value needed
}
filters {
chart_ids = # value needed
is_mandatory = # value needed
}
}
|
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
| sent on update and delete requests. | ||
|
|
||
| - name: type | ||
| type: String |
This PR introduces Terraform support for the Chronicle Native Dashboard resource by adding the
google_chronicle_native_dashboardresource.This includes:
Diffs for missing tests for "chart" properties will be ignored in a follow up PR due to its dependency on another resource hashicorp/terraform-provider-google#26521
Related Issue
Fixes hashicorp/terraform-provider-google#26483
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.